package com.hrd.service.impl;

import org.apache.commons.lang3.StringUtils;

import com.hrd.common.util.Utils;
import com.hrd.web.CustomMapper;

/**
 * Created by Administrator on 2016/8/8.
 */
public class BaseServiceImpl extends CustomMapper {

	/**
	 * 格式化排序
	 *
	 * @param sort
	 * @param order
	 * @return
	 */
	public String formatOrder(String sort, String order) {
		if (StringUtils.isNotBlank(sort)) {
			sort = Utils.camelToUnderline(sort);
			order = StringUtils.isNotBlank(order) ? order : "asc";
			return sort + " " + order;
		}
		return null;
	}



}
